home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / fl32nt.exe / OEMSETUP.INF < prev   
INI File  |  1994-01-20  |  37KB  |  1,184 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ;       Intel LAN596 network card and driver SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with.  The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ;  Types specific to networking:
  18. ;
  19. ; NetAdapter,        a netcard / adapter combination or just a netcard
  20. ; NetDriver,         just a netcard driver
  21. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  22. ; NetService,        an NT networking service
  23. ; NetWork,           a complete network ensemble.
  24. ; NetProvider        a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26.  
  27. [Identification]
  28.     OptionType = NetAdapter
  29.  
  30. ;-----------------------------------------------------------------------
  31. ; PlatformsSupported
  32. ; ------------------
  33. ; This identifies the platforms supported by the adapter card.
  34. ; Possible types are:
  35. ;
  36. ; ISA, EISA and MCA
  37. ;-----------------------------------------------------------------------
  38.  
  39. [PlatformsSupported]
  40.     EISA
  41.     "Jazz-Internal Bus"
  42.  
  43. ;-----------------------------------------------------------------------
  44. ; LANGUAGES SUPPORTED
  45. ; -------------------
  46. ;
  47. ; The languages supported by the OEM INF, For every language supported
  48. ; we need to have a separate text section for every displayable text
  49. ; section.
  50. ;
  51. ;-----------------------------------------------------------------------
  52.  
  53. [LanguagesSupported]
  54.     ENG
  55.  
  56. ;-----------------------------------------------------------------------
  57. ; OPTION LIST
  58. ; -----------
  59. ; This section lists the OEM Option key names.  These keys are locale
  60. ; independent and used to represent the option in a locale independent
  61. ; manner.
  62. ;
  63. ;-----------------------------------------------------------------------
  64.  
  65. [Options]
  66.     fl32
  67.  
  68. ;-----------------------------------------------------------------------
  69. ; OPTION TEXT SECTION
  70. ; -------------------
  71. ; These are text strings used to identify the option to the user.  There
  72. ; are separate sections for each language supported.  The format of the
  73. ; section name is "OptionsText" concatenated with the Language represented
  74. ; by the section.
  75. ;
  76. ;-----------------------------------------------------------------------
  77.  
  78. [OptionsTextENG]
  79.     fl32 = "Intel LAN596 EISA LAN Adapter"
  80.  
  81.  
  82. [Files-Inf]
  83. 1, oemsetup.inf, SIZE=65535, RENAME=$(!UG_Filename)
  84.  
  85.  
  86. [Files-fl32]
  87. 1, fl32nt.SYS, SIZE=65535
  88.  
  89. ;***********************************************************************
  90. ; CONSTANTS FOR USING DIALOGS
  91. ;***********************************************************************
  92.  
  93. [FileConstants]
  94. ;
  95. ;  File names, etc.
  96. ;
  97. UtilityInf      = "UTILITY.INF"
  98. subroutineinf   = "SUBROUTN.INF"
  99. SoftwareType    = "driver"
  100. Exit_Code       = 0
  101.  
  102. ;
  103. ; EventLog Message File
  104. ;
  105. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  106. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  107.  
  108. ; Product Info
  109. ;
  110. Manufacturer    =  "Intel"
  111. ProductMajorVersion     = "3"
  112. ProductMinorVersion     = "1"
  113. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  114. ;
  115. ; Software
  116. ;
  117. ProductSoftwareName     = "fl32"
  118. ProductSoftwareTitle    = "Intel LAN596 LAN Adapter Driver"
  119. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\fl32nt.sys"
  120. NetRuleSoftwareType     = "fl32Sys ndisDriver fl32Driver"
  121. NetRuleSoftwareUse      = $(SoftwareType)
  122. NetRuleSoftwareBindForm = """fl32Sys"" yes no container"
  123. NetRuleSoftwareClass    = {"fl32Driver basic"}
  124. NetRuleSoftwareBindable = {"fl32Driver fl32Adapter non exclusive 100"}
  125. ;
  126. ; Hardware
  127. ;
  128. ProductHardwareName     = "fl32"
  129. ProductHardwareTitle    = "Intel LAN596 Adapter"
  130. NetRuleHardwareType     = "fl32 fl32Adapter"
  131. NetRuleHardwareBindForm = " yes yes container"
  132. NetRuleHardwareClass    = {"fl32Adapter basic"}
  133. ;
  134. ;  EISA System ID Info
  135. ;
  136. NETCARD_ID      = 1102885           ; Flash32 10D425
  137. FLASH32_ID      = 269538341         ; Flash32 1010D425
  138. NETCARD1_ID     = 49749             ; Un00C255
  139. OEMCARD1_ID     = 134267477         ; Un0800C255
  140. NETCARD2_ID     = 13216416          ; SnC9AAA0
  141. OEMCARD2_ID     = 1305062048        ; Sn4DC9AAA0
  142. NETCARD3_ID     = 13216432          ; SnC9AAB0
  143. OEMCARD3_ID     = 1305062064        ; Sn4DC9AAB0
  144. NETCARD4_ID     = 13216464          ; SnC9AAD0
  145. OEMCARD4_ID     = 1305062096        ; Sn4DC9AAD0
  146. NETCARD5_ID     = 2136129           ; In209841
  147. OEMCARD5_ID     = 18913345          ; In01209841
  148.  
  149. ;
  150. ; Registry Key
  151. ;
  152. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  153. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  154.  
  155. [ProductType]
  156. STF_PRODUCT  = Winnt
  157. STF_PLATFORM = I386
  158.  
  159. [GeneralConstants]
  160. ;
  161. ;  Program flow control variables.
  162. ;
  163. from      = ""
  164. to        = ""
  165. ;
  166. ;  Return codes; Exit_Code is set to one of these
  167. ;
  168. ExitCodeOk     = 0
  169. ExitCodeCancel = 1
  170. ExitCodeFatal  = 2
  171.  
  172. KeyNull         = ""
  173. MAXIMUM_ALLOWED   = 33554432
  174. RegistryErrorIndex = NO_ERROR
  175. KeyProduct      = ""
  176. KeyParameters   = ""
  177.  
  178. TRUE            = 1
  179. FALSE           = 0
  180. NoTitle         = 0
  181.  
  182. ExitState   = "Active"
  183. OldVersionExisted = $(FALSE)
  184.  
  185. DriverPath      = $(!STF_NTPATH)\drivers
  186.  
  187. EisaId      = $(FLASH32_ID)
  188.  
  189. ;***********************************************************************
  190. ; Language-Dependent Dialog Constants
  191. ;***********************************************************************
  192.  
  193. [FileConstantsENG]
  194. ;
  195. ;  Variables to support thermometer gauge and error dialogs
  196. ;
  197. ProCaption   = "Windows NT Setup"
  198. ProCancel    = "Cancel"
  199. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  200.                "Are you sure you want to cancel copying files?"
  201.  
  202. ProCancelCap = "Network Setup Message"
  203. ProText1     = "Copying:"
  204. ProText2     = "To:"
  205.  
  206.  
  207. ;
  208. ; Product Info
  209. ;
  210. FunctionTitle = "Intel LAN596 LAN Adapter Setup"
  211. ;
  212. ; Software
  213. ;
  214. ProductSoftwareDescription = "Intel LAN596 LAN Adapter Driver"
  215. ;
  216. ; Hardware
  217. ;
  218. ProductHardwareDescription = "Intel LAN596 LAN Adapter"
  219.  
  220. ;
  221. ; Dialog Message Information
  222. ;
  223. CANNOT_FIND_ANY_CARD       = "Network card is not present in the system"
  224.  
  225.  
  226.  
  227. [DialogConstantsENG]
  228. ;
  229. ; Common button names, etc.
  230. ;
  231. Help        = "&Help"
  232. Exit        = "Cancel"
  233. OK          = "OK"
  234. HelpContext = ""
  235. Continue    = "Continue"
  236. Cancel      = "Cancel"
  237.  
  238. [date]
  239.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  240.     ; Minute, Second }
  241.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  242.  
  243. [Source Media Descriptions]
  244.     1  = "Intel LAN596 Driver Disk"  , TAGFILE = fl32nt.sys
  245.  
  246. ;-----------------------------------------------
  247. ; Input DIALOGS
  248. ;-----------------------------------------------
  249. [FileDependentDlgENG]
  250.  
  251.  
  252.  
  253. ;---------------------------------------------------------------------------
  254. ; 1. Identify
  255. ;
  256. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  257. ;                as we are choosing currently.
  258. ;
  259. ; INPUT:         None
  260. ;
  261. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  262. ;                $($R1): Option Type (COMPUTER ...)
  263. ;                $($R2): Diskette description
  264. ;---------------------------------------------------------------------------
  265.  
  266. [Identify]
  267.     ;
  268.     ;
  269.     read-syms Identification
  270.  
  271.     set !G:DebugOutputControl = 1
  272.  
  273.     set Status     = STATUS_SUCCESSFUL
  274.     set Identifier = $(OptionType)
  275.     set Media      = #("Source Media Descriptions", 1, 1)
  276.  
  277.     Return $(Status) $(Identifier) $(Media)
  278.  
  279. ;------------------------------------------------------------------------
  280. ; 2. ReturnOptions:
  281. ;
  282. ; DESCRIPTION:   To return the option list supported by this INF and the
  283. ;                localised text list representing the options.
  284. ;
  285. ;
  286. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  287. ;
  288. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  289. ;                                STATUS_NOLANGUAGE
  290. ;                                STATUS_FAILED
  291. ;                                STATUS_NOTSUPPORTED
  292. ;
  293. ;                $($R1): Option List
  294. ;                $($R2): Option Text List
  295. ;------------------------------------------------------------------------
  296.  
  297. [ReturnOptions]
  298.     ;
  299.     ;
  300.     set Status        = STATUS_FAILED
  301.     set OptionList     = {}
  302.     set OptionTextList = {}
  303.  
  304.     ;
  305.     ; Check if the language requested is supported
  306.     ;
  307.     set LanguageList = ^(LanguagesSupported, 1)
  308.     Ifcontains(i) $($0) in $(LanguageList)
  309.         ;
  310.         ; Check if the platforms requested is supported
  311.         ;
  312.         ifstr(i) $($1) == ""
  313.             goto returnoptions
  314.         endif
  315.  
  316.         set PlatformList = ^(PlatformsSupported, 1)
  317.         Ifcontains(i) $($1) in $(PlatformList)
  318.             goto returnoptions
  319.         else
  320.             set Status = STATUS_NOTSUPPORTED
  321.             goto finish_ReturnOptions
  322.         endif
  323.     else
  324.         set Status = STATUS_NOLANGUAGE
  325.         goto finish_ReturnOptions
  326.     endif
  327.  
  328.     ;
  329.     ; form a list of all the options and another of the text representing
  330.     ;
  331.  
  332. returnoptions = +
  333.     set OptionList     = ^(Options, 1)
  334.     set OptionTextList = ^(OptionsText$($0), 1)
  335.     set Status         = STATUS_SUCCESSFUL
  336.  
  337. finish_ReturnOptions = +
  338.     Return $(Status) $(OptionList) $(OptionTextList)
  339.  
  340. ;------------------------------------------------------------------------
  341. ;
  342. ; InstallOption:
  343. ;
  344. ;      This section is shelled to by main installation processing
  345. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  346. ;
  347. ;
  348. ; FUNCTION:  To copy files representing Options
  349. ;            To configure the installed option
  350. ;            To update the registry for the installed option
  351. ;
  352. ; INPUT:     $($0):  Language to use
  353. ;            $($1):  OptionID to install
  354. ;            $($2):  SourceDirectory
  355. ;            $($3):  AddCopy  (YES | NO)
  356. ;            $($4):  DoCopy   (YES | NO)
  357. ;            $($5):  DoConfig (YES | NO)
  358. ;
  359. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  360. ;                            STATUS_NOLANGUAGE |
  361. ;                            STATUS_USERCANCEL |
  362. ;                            STATUS_FAILED
  363. ;
  364. ;------------------------------------------------------------------------
  365. [InstallOption]
  366.  
  367.     set !G:DebugOutputControl = 1
  368.     ;
  369.     ; Set default values for
  370.     ;
  371.     Debug-Output "At InstallOption"
  372.     set Status   = STATUS_FAILED
  373.     ;
  374.     ; extract parameters
  375.     ;
  376.     set Option   = $($1)
  377.     set SrcDir   = $($2)
  378.     set AddCopy  = $($3)
  379.     set DoCopy   = $($4)
  380.     set DoConfig = $($5)
  381.  
  382.     ;
  383.     ; Check if the language requested is supported
  384.     ;
  385.     set LanguageList = ^(LanguagesSupported, 1)
  386.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  387.         Return STATUS_NOLANGUAGE
  388.     endif
  389.  
  390.     set-subst LF = "\n"
  391.  
  392.     read-syms GeneralConstants
  393.     read-syms FileConstants
  394.  
  395.     read-syms DialogConstants$(!STF_LANGUAGE)
  396.     ifstr(i) $(!NTN_Origination) == "NCPA"
  397.         set Continue = "OK"
  398.     endif
  399.     read-syms FileConstants$(!STF_LANGUAGE)
  400.  
  401.     detect date
  402.  
  403.     set-title  $(FunctionTitle)
  404.  
  405.     set to   = Begin
  406.     set from = Begin
  407. ;
  408. ;  Assume all is well.
  409. ;
  410.     set CommonStatus = STATUS_SUCCESSFUL
  411.  
  412.     EndWait
  413.  
  414. ;
  415. ;   Set up the operation-mode-based variables and welcome
  416. ;   the user.  If the "install mode" variable is improperly set,
  417. ;   assume this is a new installation.
  418. ;
  419.  
  420. Begin = +
  421.     Debug-Output "At Begin"
  422.  
  423.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  424.         set StartLabel = removeadapter
  425.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  426.         set StartLabel = UpgradeSoftware
  427.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  428.         set StartLabel = bindingadapter
  429.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  430.         set StartLabel = configureadapter
  431.         ;
  432.         ;   You cannot config the software component
  433.         ;
  434.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  435.             Debug-Output "Cannot configure the LAN596 driver software."
  436.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  437.         else
  438.             Debug-Output "Cannot configure the LAN596 driver software."
  439.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  440.         endif
  441.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  442.             Debug-Output "ShellCode error: cannot get an error string."
  443.             goto ShellCodeError
  444.         endif
  445.         set Error = $($R0)
  446.         set from = end
  447.         set to = end
  448.         goto nonfatalinfo
  449. ;        endif
  450.     else
  451.         set StartLabel = installadapter
  452.         set OEM_ABANDON_OPTIONS = {}
  453.         set OEM_ABANDON_SOFTWARE = FALSE
  454.         set OEM_ABANDON_ON = TRUE
  455.     endif
  456.  
  457.     Set from = $(fatal)
  458.     Set to = $(fatal)
  459.     Goto $(StartLabel)
  460.  
  461. ;-----------------------------------------------
  462. ; Installation Section
  463. ;-----------------------------------------------
  464.  
  465. installadapter = +
  466.     Debug-Output "At installadapter"
  467. ;
  468. ;   First, check whether the same version of the software exists
  469. ;
  470.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  471.  
  472.     Ifstr $(KeyProduct) != $(KeyNull)
  473.         ;
  474.         ; Same version already existed in the local machine
  475.         ; Popup the dialog and ask the user whether he wants to continue
  476.         ;
  477.         CloseRegKey $(KeyProduct)
  478.  
  479.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  480.            ;
  481.            ; Cannot Install the same software again
  482.            ;
  483.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  484.                $(ProductVersion)
  485.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  486.                Debug-Output "ShellCode error: cannot get an error string."
  487.                goto ShellCodeError
  488.            endif
  489.  
  490.            goto end
  491.         else
  492.            ;
  493.            ; Add a new adapter card?
  494.            ;
  495.            set OldVersionExisted = $(TRUE)
  496.         endif
  497.     endif
  498.  
  499.  
  500.     goto adapterverify
  501.  
  502. ;-----------------------------------------------
  503. ; Configuration Section
  504. ;-----------------------------------------------
  505. ;
  506. ;   Get the current values of all the parameters
  507. ;
  508. configureadapter = +
  509.     Debug-Output "At configureadapter"
  510.  
  511.     set Error = "Configure: Sorry, not yet implemented."
  512.     goto fatal
  513.  
  514.  
  515.     
  516. adapterverify = +
  517.  
  518.     Debug-Output "At adapterverify"
  519.  
  520.     StartWait
  521.      Debug-Output $(NETCARD1_ID)
  522.     Shell $(UtilityInf), EISAFindBus, $(NETCARD1_ID)
  523.     ifstr(i) $($R1) != {}
  524.         Debug-Output "EISA Controller found!"
  525.         set EisaId = $(OEMCARD1_ID)
  526.         goto CardFound
  527.     endif
  528.     Debug-Output "EISA Controller Search failed!"
  529.  
  530.      Debug-Output $(NETCARD2_ID)
  531.     Shell $(UtilityInf), EISAFindBus, $(NETCARD2_ID)
  532.     ifstr(i) $($R1) != {}
  533.         Debug-Output "EISA Controller found!"
  534.         set EisaId = $(OEMCARD2_ID)
  535.         goto CardFound
  536.     endif
  537.     Debug-Output "EISA Controller Search failed!"
  538.  
  539.      Debug-Output $(NETCARD3_ID)
  540.     Shell $(UtilityInf), EISAFindBus, $(NETCARD3_ID)
  541.     ifstr(i) $($R1) != {}
  542.         Debug-Output "EISA Controller found!"
  543.         set EisaId = $(OEMCARD3_ID)
  544.         goto CardFound
  545.     endif
  546.     Debug-Output "EISA Controller Search failed!"
  547.  
  548.      Debug-Output $(NETCARD4_ID)
  549.     Shell $(UtilityInf), EISAFindBus, $(NETCARD4_ID)
  550.     ifstr(i) $($R1) != {}
  551.         Debug-Output "EISA Controller found!"
  552.         set EisaId = $(OEMCARD4_ID)
  553.         goto CardFound
  554.     endif
  555.     Debug-Output "EISA Controller Search failed!"
  556.  
  557.      Debug-Output $(NETCARD5_ID)
  558.     Shell $(UtilityInf), EISAFindBus, $(NETCARD5_ID)
  559.     ifstr(i) $($R1) != {}
  560.         Debug-Output "EISA Controller found!"
  561.         set EisaId = $(OEMCARD5_ID)
  562.         goto CardFound
  563.     endif
  564.     Debug-Output "EISA Controller Search failed!"
  565.  
  566.      Debug-Output $(NETCARD_ID)
  567.     Shell $(UtilityInf), EISAFindBus, $(NETCARD_ID)
  568.     ifstr(i) $($R1) != {}
  569.         Debug-Output "EISA Controller found!"
  570.         set EisaId = $(FLASH32_ID)
  571.         goto CardFound
  572.     endif
  573.     Debug-Output "EISA Controller Search failed!"
  574.     goto ShellCodeError
  575.  
  576. CardFound =  +
  577.     ifstr $($R0) != "NO_ERROR"
  578.         set Error = $($R0)
  579.         goto fatal
  580.     endif
  581.     ifstr(i) $($R1) == {}
  582.         set Error = $(CANNOT_FIND_ANY_CARD)
  583.         set CommonStatus = STATUS_USERCANCEL
  584.         set from = end
  585.         goto nonfatal
  586.     endif
  587.     set AdapterList = $($R1)
  588.     ;
  589.     ; Add Software Component
  590.     ;
  591.     ifint $(OldVersionExisted) == $(FALSE)
  592.         ifstr(i) $(!NTN_InstallMode) == "install"
  593.            Ifstr(i) $(DoCopy) == "YES"
  594.  
  595.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  596.  
  597.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  598.                   Goto ShellCodeError
  599.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  600.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  601.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  602.                       goto ShellCodeError
  603.                   endif
  604.                   set Error = $($R0)
  605.                   Goto fatal
  606.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  607.                   Goto successful
  608.               Endif
  609.  
  610.               Set SrcDir = $($R1)
  611.  
  612.            Endif
  613.  
  614.            install "Install-Option"
  615.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  616.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  617.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  618.                   goto ShellCodeError
  619.               endif
  620.               set Error = $($R0)
  621.               goto fatal
  622.            endif
  623.         endif
  624.  
  625.         Debug-Output "At AddSoftwareComponent"
  626.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  627.             $(ProductSoftwareName), +
  628.             $(ProductSoftwareName), +
  629.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  630.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  631.             $(NetEventDLL)
  632.  
  633.         Set OEM_ABANDON_SOFTWARE = TRUE
  634.  
  635.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  636.             Debug-Output "ShellCode error"
  637.             goto ShellCodeError
  638.         endif
  639.         ;
  640.         ;   At this point:
  641.         ;     $R1 contains the product version key handle;
  642.         ;     $R2 contains the NetRules subkey handle;
  643.         ;     $R3 contains the new Services key handle; and
  644.         ;     $R4 contains the Parameters key
  645.         ;     $R5 contains the Linkage Key
  646.         ;
  647.         set RegistryErrorIndex = $($R0)
  648.         set KeyProduct      = $($R1)
  649.         Set SoftNetRulesKey = $($R2)
  650.         CloseRegKey $($R3)
  651.         CloseRegKey $($R4)
  652.         CloseRegKey $($R5)
  653.  
  654.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  655.             EndWait
  656.             Debug-Output "Registry error: add software components"
  657.             CloseRegKey $(KeyProduct)
  658.             CloseRegKey $(SoftNetRulesKey)
  659.             goto fatalregistry
  660.         endif
  661.  
  662.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  663.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  664.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  665.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  666.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  667.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  668.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  669.  
  670.         Debug-Output "At AddValueList - SoftwareType"
  671.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  672.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  673.             Debug-Output "ShellCode error."
  674.             goto ShellCodeError
  675.         endif
  676.  
  677.         set RegistryErrorIndex = $($R0)
  678.  
  679.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  680.             EndWait
  681.             Debug-Output "Registry error: add value list."
  682.             CloseRegKey $(KeyProduct)
  683.             CloseRegKey $(SoftNetRulesKey)
  684.             goto fatalregistry
  685.         endif
  686.  
  687.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  688.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  689.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  690.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  691.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  692.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  693.  
  694.         Debug-Output "At AddValueList - bindform"
  695.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  696.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  697.             Debug-Output "ShellCode error."
  698.             goto ShellCodeError
  699.         endif
  700.  
  701.         set RegistryErrorIndex = $($R0)
  702.  
  703.         CloseRegKey $(KeyProduct)
  704.         CloseRegKey $(SoftNetRulesKey)
  705.  
  706.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  707.             EndWait
  708.             Debug-Output "Resgitry error: add value list."
  709.             goto fatalregistry
  710.         endif
  711.     endif
  712. ;
  713. ;   Create the HARDWARE\Netcard region and its corresponding service
  714. ;
  715.     ForListDo $(AdapterList)
  716.         set BusNum = *($($),1)
  717.         set SlotNum = *($($),2)
  718.         Debug-Output $(BusNum)
  719.         Debug-Output $(SlotNum)
  720.         Shell $(UtilityInf), IsNetCardAlreadyInstalled, $(BusNum), +
  721.             $(SlotNum), $(ProductHardwareDescription), $(ProductHardwareName)
  722.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  723.             goto ShellCodeError
  724.         endif
  725.         ifstr $($R0) != "NO_ERROR"
  726.             set Error = $($R0)
  727.             goto fatal
  728.         endif
  729.         ifstr(i) $($R1) != "YES"
  730.                 Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  731.  
  732.                 ifint $($R4) != -1
  733.                     Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  734.                 endif
  735.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  736.                     goto ShellCodeError
  737.                 endif
  738.  
  739.                 set RegistryErrorIndex = $($R0)
  740.                 Ifstr(i) $(RegistryErrorIndex) != "NO_ERROR"
  741.                     EndWait
  742.                     CloseRegKey $($R1)
  743.                     CloseRegKey $($R2)
  744.                     CloseRegKey $($R3)
  745.                     goto fatalregistry
  746.                 endif
  747.                ;
  748.                ;   At this point:
  749.                ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  750.                ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  751.                ;     $R3  Registry key handle for <service>\Parameters key
  752.                ;     $R4  Adapter number assigned to adapter
  753.                ;     $R5  Service name generated by combining svc name with adapter number
  754.                ;
  755.                 Set HardNetCardKey      = $($R1)
  756.                 Set HardNetRuleKey      = $($R2)
  757.                 Set HardParameterKey    = $($R3)
  758.                 set AdapterNumber       = $($R4)
  759.  
  760.                 set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  761.                                    {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardwareTitle)},+
  762.                                    {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareDescription)},+
  763.                                    {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  764.                                    {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  765.                                    {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  766.  
  767.                 Shell  $(UtilityInf), AddValueList, $(HardNetCardKey), $(NewValueList)
  768.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  769.                     goto ShellCodeError
  770.                 endif
  771.                 set NewValueList = {{BusNumber,$(NoTitle),$(!REG_VT_DWORD),$(BusNum)},+
  772.                                    {BusType,$(NoTitle),$(!REG_VT_DWORD),2},+
  773.                                    {Eid,$(NoTitle),$(!REG_VT_DWORD),$(EisaId)},+
  774.                                    {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  775.                                    {Driv,$(NoTitle),$(!REG_VT_DWORD),2},+
  776.                                    {Slot,$(NoTitle),$(!REG_VT_DWORD),$(SlotNum)}}
  777.                 Shell  $(UtilityInf), AddValueList, $(HardParameterKey), $(NewValueList)
  778.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  779.                     goto ShellCodeError
  780.                 endif
  781.                  set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  782.                  set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  783.                  set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  784.                                      {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  785.                                     {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  786.                                     {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)} }
  787.                 Shell  $(UtilityInf), AddValueList, $(HardNetRuleKey), $(NewValueList)
  788.                 CloseRegKey $(HardNetCardKey)
  789.                 CloseRegKey $(HardNetRuleKey)
  790.                 CloseRegKey $(HardParameterKey)
  791.                 ifint $($ShellCode) != $(!SHELL_CODE_OK)
  792.                     goto ShellCodeError
  793.                 endif
  794.         endif
  795.     EndForListDo
  796. ;
  797. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  798. ;
  799. writeparameters = +
  800.     Debug-Output "At writeparameters"
  801.     EndWait
  802.     goto successful
  803.  
  804. ;-----------------------------------------------
  805. ; Binding section
  806. ;-----------------------------------------------
  807. bindingadapter =+
  808.     Debug-Output "At bindingadapter"
  809.     set Error = "Binding: Sorry, not yet implemented."
  810.     goto fatal
  811.  
  812. ;-----------------------------------------------
  813. ; Removeadapter section
  814. ;-----------------------------------------------
  815.  
  816. removeadapter = +
  817.     Debug-Output "At removeadapter"
  818.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  819.         ; Remove Software Component
  820.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  821.             $(ProductSoftwareName)
  822.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  823.             Debug-Output "ShellCode error"
  824.             goto ShellCodeError
  825.         endif
  826.  
  827.         set RegistryErrorIndex = $($R0)
  828.  
  829.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  830.             goto fatalregistry
  831.         endif
  832.     else
  833.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  834.             $(ProductSoftwareName), $(!NTN_RegBase)
  835.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  836.             Debug-Output "ShellCode error"
  837.             goto ShellCodeError
  838.         endif
  839.  
  840.         set RegistryErrorIndex = $($R0)
  841.  
  842.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  843.             goto fatalregistry
  844.         endif
  845.     endif
  846.  
  847.     goto end
  848.  
  849. ;-----------------------------------------------
  850. ; Upgrade Software section
  851. ;-----------------------------------------------
  852.  
  853. UpgradeSoftware = +
  854.     Debug-Output "At UpgradeSoftware"
  855.     ;
  856.     ; First determine whether we want to do upgrade or update for software
  857.     ; or hardware component. Then we will determine whether the Mode is
  858.     ; update or upgrade.
  859.     ;
  860.     ; If the same version of the product existed in the registry, we do
  861.     ; update. Otherwise, we will do a upgrade
  862.     ;
  863.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  864.         ; Upgrade software component
  865.         ;
  866.         ; see whether the same version exist or not
  867.         ;
  868.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  869.  
  870.         Ifstr $(KeyProduct) != $(KeyNull)
  871.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  872.             set Version = *($(VersionInfo), 4)
  873.  
  874.             ;
  875.             ; Update the binaries
  876.             ;
  877.             Split-String $(!NTN_Infname), "\", FilenameList
  878.             QueryListSize ListSize $(FilenameList)
  879.             set !UG_Filename = *($(FilenameList), $(ListSize))
  880.  
  881.             install "Install-Update"
  882.             ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  883.                 goto fatal
  884.             endif
  885.  
  886.             ; Upgrade the version number
  887.             ;
  888.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  889.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  890.  
  891.             ;
  892.             ; do nothing for update
  893.             ;
  894.             ifint $(Version) != $(ProductVersion)
  895.                ;
  896.                ; If the major version number is not the same,
  897.                ; it is major upgrade. So let Upgrade the product
  898.                ;
  899.                ;
  900.                ; make other upgrade change if necessary
  901.                ;
  902.             endif
  903.             CloseRegKey $(KeyProduct)
  904.         else
  905.             ;
  906.             ; Cannot Open software key, goto ERROR
  907.             ;
  908.             goto fatalregistry
  909.         endif
  910.     else
  911.         ;
  912.         ; upgrade/update hardware component
  913.         ; There is no different between upgrade and update for hardware
  914.         ; component
  915.         ;
  916.         ; 1. Get the Service Name
  917.         ; 2. Change the NetRule section if necessary
  918.         ;
  919.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  920.               $(MAXIMUM_ALLOWED) NetworkCardKey
  921.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  922.             ;
  923.             ; Get Service name
  924.             ;
  925.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  926.             set ServiceName = *($(ServiceNameInfo), 4)
  927.  
  928.             ;
  929.             ; Change the NetRule if necessary
  930.             ;
  931.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  932.                 $(MAXIMUM_ALLOWED) NetRuleKey
  933.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  934.                 ;
  935.                 ; Make the change....
  936.                 ;
  937.             else
  938.                 ;
  939.                 ; Error, cannot open net rules key
  940.                 ;
  941.                 goto fatalregistry
  942.             endif
  943.  
  944.             CloseRegKey $(NetRules)
  945.             CloseRegKey $(NetworkCardKey)
  946.         else
  947.             ;
  948.             ; Error, cannot open network card key
  949.             ;
  950.             goto fatalregistry
  951.         endif
  952.         ;
  953.         ; 3. Change the service section of the hardware. i.e.,
  954.         ;    ParameterName change, value change, etc.
  955.         ;
  956.         OpenRegKey $(!REG_H_LOCAL) "" +
  957.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  958.               $(MAXIMUM_ALLOWED) ServiceKey
  959.  
  960.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  961.             ;
  962.             ; Get the ServiceKey to change the Start value
  963.             ; or Type value. Or open Parameters key to
  964.             ; change the hardware parameters if necessary.
  965.             ;
  966.             CloseRegKey $(ServiceKey)
  967.         else
  968.             ;
  969.             ; Error, cannot open network card key
  970.             ;
  971.             goto fatalregistry
  972.         endif
  973.     endif
  974.  
  975.     goto end
  976.     ;
  977.     ; End of Upgrade Software
  978.     ;
  979.  
  980. ;
  981. ;  Escape hatches
  982. ;
  983. successful = +
  984.     Debug-Output "At successful"
  985.     goto end
  986.  
  987. abandon = +
  988.     Debug-Output "At abandon"
  989.     ForListDo $(OEM_ABANDON_OPTIONS)
  990.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  991.             $(ProductSoftwareName), $($)
  992.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  993.             Debug-Output "ShellCode error"
  994.             goto ShellCodeError
  995.         endif
  996.  
  997.         set RegistryErrorIndex = $($R0)
  998.  
  999.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1000.             goto fatalregistry
  1001.         endif
  1002.     EndForListDo
  1003.  
  1004.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1005.         ; Remove Software Component
  1006.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1007.             $(ProductSoftwareName), FALSE
  1008.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1009.             Debug-Output "ShellCode error"
  1010.             goto ShellCodeError
  1011.         endif
  1012.  
  1013.         set RegistryErrorIndex = $($R0)
  1014.  
  1015.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1016.             goto fatalregistry
  1017.         endif
  1018.     endif
  1019.  
  1020.     goto end
  1021.  
  1022. ;
  1023. ; warning display
  1024. ;
  1025. warning = +
  1026.     Debug-Output "At warning"
  1027.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1028.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1029.         goto ShellCodeError
  1030.     endif
  1031.     ifstr(i) $($R1) == "OK"
  1032.         goto $(to)
  1033.     else-ifstr(i) $($R1) == "CANCEL"
  1034.         goto $(from)
  1035.     else
  1036.         goto "end"
  1037.     endif
  1038. ;
  1039. ; non fatal error display
  1040. ;
  1041. nonfatalinfo = +
  1042.     Debug-Output "At nonfatalinfo"
  1043.     Set Severity = STATUS
  1044.     Set CommonStatus = STATUS_USERCANCEL
  1045.     goto nonfatalmsg
  1046. nonfatal = +
  1047.     Debug-Output "At nonfatal"
  1048.     Set Severity = NONFATAL
  1049.     goto nonfatalmsg
  1050. nonfatalmsg = +
  1051.     Debug-Output "At nonfatalmsg"
  1052.     ifstr(i) $(Error) == ""
  1053.         Set Severity = NONFATAL
  1054.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1055.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1056.             goto ShellCodeError
  1057.         endif
  1058.         set Error = $($R0)
  1059.     endif
  1060.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1061.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1062.         goto ShellCodeError
  1063.     endif
  1064.     ifstr(i) $($R1) == "OK"
  1065.         goto $(from)
  1066.     else
  1067.         goto "end"
  1068.     endif
  1069.  
  1070. ;
  1071. ;  Registry is broken
  1072. ;
  1073. fatalregistry = +
  1074.     Debug-Output "At fatalregistry"
  1075.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1076.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1077.         goto ShellCodeError
  1078.     endif
  1079.     set Error = $($R0)
  1080.     goto fatal
  1081. ;
  1082. ; fatal error display
  1083. ;
  1084. fatal = +
  1085.     Debug-Output "At fatal"
  1086.     ifstr(i) $(Error) == ""
  1087.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1088.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1089.             goto ShellCodeError
  1090.         endif
  1091.         set Error = $($R0)
  1092.     endif
  1093.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1094.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1095.         goto ShellCodeError
  1096.     endif
  1097.  
  1098.     goto setfailed
  1099.  
  1100. ;
  1101. ;  Shelling error
  1102. ;
  1103. ShellCodeError = +
  1104.     Debug-Output "At ShellCodeError"
  1105.     set DlgType      = "MessageBox"
  1106.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1107.     set STF_MB_TEXT  = "Shell Code Error"
  1108.     set STF_MB_TYPE  = 1
  1109.     set STF_MB_ICON  = 3
  1110.     set STF_MB_DEF   = 1
  1111.     ui start "Error Message"
  1112.     goto setfailed
  1113.  
  1114. setfailed = +
  1115.     Debug-Output "At setfailed"
  1116.     set CommonStatus = STATUS_FAILED
  1117.     ;
  1118.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1119.     ;
  1120.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1121.         set OEM_ABANDON_ON = FALSE
  1122.         goto abandon
  1123.     endif
  1124.     goto end
  1125.  
  1126. end = +
  1127.     Debug-Output "At end"
  1128.     goto term
  1129.  
  1130. term = +
  1131.     Debug-Output "At term"
  1132.     Return $(CommonStatus)
  1133.  
  1134.  
  1135. [DebugConfiguration]
  1136.     return
  1137.  
  1138.  
  1139. ;***************************************************************
  1140. ;  INSTALL SECTIONS
  1141. ;***************************************************************
  1142. [Install-Option]
  1143.     Debug-Output "At Install-Option"
  1144.     set STF_VITAL = ""
  1145.  
  1146.     ifstr(i) $(AddCopy) == "YES"
  1147.  
  1148.         ;
  1149.         ; Add the files to the copy list
  1150.         ;
  1151.         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1152.         ;      the other INF files
  1153.         ;
  1154.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1155.  
  1156.     endif
  1157.  
  1158.     ifstr(i) $(DoCopy) == "YES"
  1159.  
  1160.        ;
  1161.        ; Copy files in the copy list
  1162.        ;
  1163.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1164.        CopyFilesInCopyList
  1165.  
  1166.     endif
  1167.  
  1168.     Exit
  1169.  
  1170. [Install-Update]
  1171.     Debug-Output "At Install-Update"
  1172.    set STF_VITAL        = ""
  1173.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1174.    ;set STF_VERSION     = "YES"
  1175.  
  1176.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1177.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1178.  
  1179.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1180.    CopyFilesInCopyList
  1181.  
  1182.    exit
  1183.  
  1184.